package com.nbsaas.boot.ai.rest.resource;

import com.nbsaas.boot.ai.api.apis.AiAgentConfigApi;
import com.nbsaas.boot.ai.data.entity.AiAgentConfig;
import com.nbsaas.boot.ai.api.domain.request.AiAgentConfigRequest;
import com.nbsaas.boot.ai.api.domain.response.AiAgentConfigResponse;
import com.nbsaas.boot.ai.api.domain.simple.AiAgentConfigSimple;
import com.nbsaas.boot.ai.rest.convert.AiAgentConfigSimpleConvert;
import com.nbsaas.boot.ai.rest.convert.AiAgentConfigEntityConvert;
import com.nbsaas.boot.ai.rest.convert.AiAgentConfigResponseConvert;
import com.nbsaas.boot.ai.data.repository.AiAgentConfigRepository;

import java.io.Serializable;

import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;

/**
 * 智能体配置-业务接口实现
 */
@Transactional
@Service
public class AiAgentConfigResource extends BaseResource<AiAgentConfig, AiAgentConfigResponse, AiAgentConfigSimple, AiAgentConfigRequest> implements AiAgentConfigApi {

    @Resource
    private AiAgentConfigRepository aiAgentConfigRepository;

    @Override
    public JpaRepositoryImplementation<AiAgentConfig, Serializable> getJpaRepository() {
        return aiAgentConfigRepository;
    }

    @Override
    public Function<AiAgentConfig, AiAgentConfigSimple> getConvertSimple() {
        return new AiAgentConfigSimpleConvert();
    }

    @Override
    public Function<AiAgentConfigRequest, AiAgentConfig> getConvertForm() {
        return new AiAgentConfigEntityConvert();
    }

    @Override
    public Function<AiAgentConfig, AiAgentConfigResponse> getConvertResponse() {
        return new AiAgentConfigResponseConvert();
    }


}


